import React, { useState } from 'react'

import { Layout } from 'antd';
import Bus from '@/utils/events'
// 引入Appmenu 组件
import Appmenu from '@/components/Appmenu'
const { Sider } = Layout;

type Props = {}

export default function Appaside({ }: Props) {
    const [collapsed, setCollapsed] = useState(false);
    Bus.on('myevents', (data) => {
        // console.log('data', data);
        // 修改兄弟组件传过来的值
        setCollapsed(data)
    })
    return (
        <Sider trigger={null} collapsible collapsed={collapsed}>
            <div className="demo-logo-vertical" />
            {/* 左侧菜单组件 */}
            <Appmenu></Appmenu>
        </Sider>
    )
}